//
//  UIView+LZSSetUpView.m
//  IOSProject
//
//  Created by lzs on 2018/4/20.
//  Copyright © 2018年 com.linzhisheng. All rights reserved.
//

#import "UIView+LZSSetUpView.h"

@implementation UIView (LZSSetUpView)

-(UILabel *)setuplabelwithfont:(UIFont *)font withText:(NSString *)text withColor:(UIColor *)color wihtAlignemt:(NSTextAlignment)textalignment{
    UILabel *label = [[UILabel alloc] init];
    label.text = text;
    label.font = font;
    label.textAlignment = textalignment;
    label.textColor = color;
    return label;
}

-(UITextField *)setupTextFieldwithfont:(UIFont *)font withPlaceHolder:(NSString *)holder withColor:(UIColor *)color wihtAlignemt:(NSTextAlignment)textalignment withview:(UIView *)leftView {
    UITextField *label = [[UITextField alloc] init];
    label.font = font;
    label.textAlignment = textalignment;
    label.textColor = color;
    label.placeholder = holder;
    label.clearButtonMode = UITextFieldViewModeAlways;
    if (leftView) {
        label.leftViewMode = UITextFieldViewModeAlways;
        label.leftView = leftView;
    }
    return label;
}

-(UIButton *)setupbtnWithFont:(UIFont *)font withText:(NSString *)text withColor:(UIColor *)color wihtAlignemt:(NSTextAlignment)textalignment{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:text forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    btn.titleLabel.font = font;
    btn.titleLabel.textAlignment = textalignment;
    
    return btn;
}

@end
